package com.sun.mybatisplus.config;

import com.sun.mybatisplus.bean.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.ServletRequest;

@RestControllerAdvice
public class MyExceptionConfig {

    @ExceptionHandler(Exception.class)
    public R globalExceptionHandler(Exception exception, ServletRequest request){
        return new R("500","系统繁忙",exception.getMessage());
    }

}
